[PATCH] posix: fix system when a child cannot be created [BZ #32450]
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 19 Dec 2024 22:55:15 +0000 (23:55 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sat, 15 Feb 2025 10:20:09 +0000 (11:20 +0100)
commit963f137a9bb06d4f167437a3c575757d0f36ad1b
tree71065e7fabaa50c802c68f152079fdb95cf0d321
parent02505b1610c24545b4d165bf66ddbf0e74bcfbc4
[PATCH] posix: fix system when a child cannot be created [BZ #32450]

POSIX states that "if a child process cannot be created, or if the
termination status for the command language interpreter cannot be
obtained, system() shall return -1 and set errno to indicate the error."

In the glibc implementation it could happen when posix_spawn fails,
which happens when the underlying fork, vfork, or clone call fails. They
could fail with EAGAIN and ENOMEM.

Resolves: BZ #32450
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gbp-Pq: Topic any
Gbp-Pq: Name git-posix-fix-system-when-a-child-cannot-be-created-BZ-3.patch
stdlib/tst-system.c
sysdeps/posix/system.c